MCP 101

Building the Next Generation of Context-Aware AI Agents

Model Context Protocol Workshop

The Dawn of Agentic AI

From text generation to real-world action

  • AI agents can now reason, plan, and use tools
  • Microsoft Discovery: AI-discovered sustainable cooling material
  • Autonomous competitive analysis in under 50 minutes
  • HeyGen Video Agent: prompt-to-video generation

The paradigm shift: Passive content creation → Active problem-solving

The Context Gap Problem

LLMs are “incredibly smart in a vacuum”

The Challenges

  • Knowledge Cutoff: Frozen training data
  • Data Silos: No access to private/real-time data
  • N×M Integration: Every model needs custom connections

The Impact

  • 80% of AI projects fail due to data access issues
  • Complex “context engineering” required
  • Vendor lock-in and brittle integrations

Integration: Before vs After MCP

Aspect Traditional (N×M) MCP Standard
Integration Effort High: Custom code for each pair Low: One server, any client
Discoverability Manual documentation reading Automated runtime reflection
Interoperability Vendor-locked Model-agnostic open standard
Security Ad-hoc API key management OAuth 2.1, scopes, consent
Scalability Poor: N×M complexity Excellent: N+M complexity

Meet MCP: The Universal Standard

Model Context Protocol - Anthropic, November 2024

Key Analogies

  • “USB-C for AI”: Universal connector for AI peripherals
  • “LSP for AI”: Like Language Server Protocol for editors

Core Benefits

  • Open, model-agnostic standard
  • Network effects: build once, use everywhere
  • Future-proof architecture

MCP Architecture

graph TD
    A[MCP Host<br/>Claude Desktop, Cursor IDE] --> B[MCP Client 1]
    A --> C[MCP Client 2]
    A --> D[MCP Client N]
    B --> E[ArXiv Server]
    C --> F[GitHub Server]
    D --> G[Database Server]
    
    style A fill:#e1f5fe
    style E fill:#f3e5f5
    style F fill:#f3e5f5
    style G fill:#f3e5f5

  • Host: User-facing application
  • Client: Manages connections (1:1 with servers)
  • Server: Exposes specific capabilities via JSON-RPC 2.0

Our Demo: AI Research Assistant

Goal: Build an agent that finds, analyzes, and manages academic papers

Implementation Plan

  1. Scaffold: Basic ArXiv search server
  2. Expand: Add Tools, Resources, and Prompts
  3. Enhance: Progress notifications and logging
  4. Secure: OAuth authentication with Zotero
  5. Advanced: Elicitation, Roots, and Sampling

Step 1: Scaffolding the ArXiv Server

Setup

uv init arxiv-assistant
uv venv
source .venv/bin/activate
uv add "mcp[cli]" arxiv

Simple Server

from mcp.server.fastmcp import FastMCP
import arxiv

mcp = FastMCP("ArXiv Research Server")

@mcp.tool()
def search_papers(query: str, max_results: int = 5):
    """Search ArXiv for scientific papers"""
    # Implementation here
    pass

Run and test: uv run python server.py

MCP’s Three Core Primitives

Primitive Purpose Analogy Example
Tools Executable actions with side effects POST Request download_paper(paper_id)
Resources Read-only, file-like data GET Request arxiv/{paper_id}/abstract
Prompts Reusable workflow templates Workflow “Deep Paper Analysis”

Benefits: Clear separation of concerns, better security, predictable behavior

Code Demo: Complete ArXiv Server

from mcp.server.fastmcp import FastMCP
import arxiv
from pydantic import BaseModel

mcp = FastMCP("ArXiv Research Server", port=8002)

class Paper(BaseModel):
    title: str
    authors: list[str]
    summary: str
    pdf_url: str

@mcp.tool()
def search_papers(query: str, max_results: int = 5) -> list[Paper]:
    """Searches ArXiv database for scientific papers"""
    search = arxiv.Search(query=query, max_results=max_results)
    results = []
    for r in search.results():
        results.append(Paper(
            title=r.title,
            authors=[author.name for author in r.authors],
            summary=r.summary,
            pdf_url=r.pdf_url,
        ))
    return results

@mcp.resource("arxiv/{paper_id}/abstract")
def get_abstract(paper_id: str) -> str:
    """Get the abstract of a specific paper"""
    # Implementation here
    pass

if __name__ == "__main__":
    mcp.run(transport="streamable-http")

Enhanced UX: Progress Tracking

The Problem

  • Long-running operations leave users waiting
  • No feedback during downloads or processing
  • Poor user experience

MCP Solution

  • Built-in notification system
  • Progress tokens for tracking
  • Real-time status updates

Implementation

{
  "method": "notifications/progress",
  "params": {
    "progressToken": "download-xyz-789",
    "progress": 5,
    "total": 20,
    "message": "Downloading paper 5 of 20..."
  }
}

Security: OAuth 2.1 Authentication

Challenge: Access private Zotero library safely

Traditional OAuth Pain

  • Manual app registration
  • Copy-paste client credentials
  • N×M authentication problem

MCP Innovation

  • Dynamic Client Registration
  • Automatic endpoint discovery
  • One-click user consent
  • PKCE security protection

Result: Most secure path is also the easiest path

Authentication Flow

sequenceDiagram
    participant User
    participant Client
    participant Server
    participant Zotero
    
    User->>Client: "Save paper to Zotero"
    Client->>Server: add_paper_to_collection()
    Server-->>Client: 401 Unauthorized
    Client->>Zotero: OAuth authorization request
    Zotero->>User: Login & consent screen
    User->>Zotero: Approve access
    Zotero->>Client: Authorization code
    Client->>Zotero: Exchange for access token
    Client->>Server: Retry with Bearer token
    Server->>Client: Success!

Advanced Interactive Patterns

Elicitation

Runtime user input

{
  "message": "Which transformers?",
  "requestedSchema": {
    "topic": {
      "enum": ["ai_models", "electrical"]
    }
  }
}

Roots

Security boundaries

file:///Users/researcher/
  AI_Papers_Project/

Prevents access outside designated directories

Sampling

Server requests LLM

Server asks client’s LLM to summarize content or analyze data

The Growing MCP Ecosystem

Category Examples Capabilities
Developer Tools GitHub, GitLab, Docker, Playwright Code management, CI/CD, automation
Databases PostgreSQL, Redis, Vector DBs Structured data, embeddings, caching
Communication Slack, Gmail, Teams Messaging, email, calendar
Productivity Google Drive, Notion, Zotero Files, documents, references
Web Search Brave, DuckDuckGo, Tavily Real-time search and data
Aggregators Zapier, Pipedream Thousands of SaaS integrations

Getting Started: Developer Resources

Essential Resources

  • Official Docs: modelcontextprotocol.io
  • Protocol Spec: Complete technical specification
  • SDKs: Python, TypeScript, Java, C#, Go
  • MCP Inspector: Interactive debugging tool

Learning & Community

  • DeepLearning.AI Course: Structured tutorials
  • awesome-mcp-servers: Curated examples
  • Community: Reddit r/mcp, Discord servers
  • Quick Start: Build your first server in minutes

Demo Time!

Let’s see our AI Research Assistant in action

  1. Search for papers on “transformer models”
  2. Download a specific paper
  3. Save it to Zotero library
  4. Generate a summary with progress tracking

The Future is Composable

MCP resolves the critical context gap

  • Universal language for AI integration
  • Composable agents working in concert
  • Network effects drive rapid ecosystem growth

Your Next Steps

  1. Identify a tool you use daily
  2. Build a simple MCP server for it
  3. Contribute to the growing ecosystem
  4. Unlock its potential for all AI applications

The time to start building is now.

Questions & Discussion

Thank you!

Resources

  • Demo Code: Available in this repository
  • Documentation: modelcontextprotocol.io
  • Community: Join the MCP ecosystem

Let’s build the future of AI together.